package com.ruoyi.common.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class JSONUtil {
    public static String toJsonString(Object object){
        String result = null;
        try{
            ObjectMapper mapper = new ObjectMapper();
            result = mapper.writeValueAsString(object);
        }catch (Exception e){
            log.info("转换JSON字符串出错：{}",e.getMessage());
        }

        return result;
    }
}
